package com.example.controller;

import com.example.domain.ResponseResult;
import com.example.domain.entity.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @PostMapping("/register")
    public ResponseResult register(@RequestBody User user){
        return userService.register(user);
    }

    @GetMapping("/selectByAge")
    public ResponseResult selectByAge(){return userService.selectByAge();}

    @GetMapping("/selectByProvince")
    public ResponseResult selectByProvince(){return userService.selectByProvince();}

    @GetMapping("/selectByTag")
    public ResponseResult selectByTag(){return userService.selectByTag();}

    @GetMapping("/selectByJob")
    public ResponseResult selectByJob(){return userService.selectByJob();}
}
